import { RouteRecordRaw, RouterView } from 'vue-router'

import { redirectPath } from '../help'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/role-manage',
    component: RouterView,
    meta: { title: '角色管理', auth: 'admin-role-manage-list' },
    redirect: redirectPath,
    children: [
      {
        path: '/role-manage/list',
        component: () => import('@/views/admin/role-manage/list/index.vue'),
        meta: { title: '角色列表', auth: 'admin-role-manage-list' }
      },
      {
        path: '/role-manage/detail/:id',
        component: () => import('@/views/admin/role-manage/detail/index.vue'),
        meta: { title: '角色详情', auth: 'admin-role-manage-list' }
      },
      {
        path: '/role-manage/add',
        component: () => import('@/views/admin/role-manage/edit/index.vue'),
        meta: { title: '新增角色', auth: 'admin-role-manage-list' }
      },
      {
        path: '/role-manage/edit/:id',
        component: () => import('@/views/admin/role-manage/edit/index.vue'),
        meta: { title: '编辑角色', auth: 'admin-role-manage-list' }
      }
    ]
  }
]

export default routes
